<template>
	<view>
		<image class="success-icon" src="../../static/imgs/icons/success-icon.png" mode="aspectFill"></image>
		<view class="btn_list">
			<view class="btn_item back" @click="handleGoHome">返回首页</view>
			<view class="btn_item go" @click="handleGoOrderDetail">查看订单</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				orderId: 0,
				type: '',
				toAndFor: false,
			};
		},
		onLoad(opt) {
			this.orderId = opt && opt.id
			this.type = opt && opt.type
			this.toAndFor = opt && opt.toAndFor && opt.toAndFor === 'true' ? true : false
		},
		methods: {
			handleGoHome() {
				uni.switchTab({
					url: '../tabbar/home'
				});
			},
			handleGoOrderDetail() {
				let url = '../../pagesUser/order/'+ this.type +'.orderDetail?id=' + this.orderId + '&type=1&status=1&hideBtn=true&toAndFor=' + this.toAndFor
				uni.navigateTo({url});
			}
		}
	}
</script>

<style lang="scss" scoped>
.success-icon {
	display: block;
	width: 228rpx;
	height: 208rpx;
	margin: 140rpx auto 98rpx;
}
.btn_list {
	padding: 0 120rpx;
	display: flex;
	justify-content: space-between;
	.btn_item {
		width:240rpx;
		height:80rpx;
		line-height: 80rpx;
		text-align: center;
		border:2rpx solid #00B4FF;
		border-radius:40rpx;
		font-size: 28rpx;
		&.back {
			color: #00B4FF;
		}
		&.go {
			color: #fff;
			border:none;
			background:linear-gradient(90deg,rgba(0,180,255,1),rgba(16,218,255,1));
		}
	}
}
</style>
